﻿var Array = new Array();

$("input[type=checkbox]").click(function () {
    var ID = $(this).attr('id');
    var Checked = Array.indexOf(ID);
    if (Checked == -1) {
        Array.push(ID);
    }
    else {
        for (var i = Array.length; i >= 0; i--) {
            if (Array[i] == ID) {
                Array.splice(i, 1);
            }
        }
    }
});

$("input[id=admin-tools-remove-button]").click(function () {
    for (var i = 0; i < Array.length; i++) {
        var IdFromArray = { "id": Array[i] };
        $.post('/Account/AdminRemoveGame', IdFromArray, function () {
        });
    }
    setTimeout(function () {
        location.reload();
    }, 250);
});

$("input[id=admin-tools-ban]").click(function () {
    for (var i = 0; i < Array.length; i++) {
        var IdFromArray = { "UserId": Array[i] };
        $.post('/Account/AdminBan', IdFromArray, function () {
        });
    }
    setTimeout(function () {
        location.reload();
    }, 250);
});

$("input[id=admin-tools-warning]").click(function () {
    for (var i = 0; i < Array.length; i++) {
        var IdFromArray = { "UserId": Array[i] };
        //Óli HÉÉÉÉÉÉÉR!!!!
    }
});



$("#admin-tools-add-game").click(function () {
    window.location = "/Game/AddGame";
});